#include <header.h>

int main(){

    // 打开目录流
    DIR *dir = opendir("/home/snow/code/2th/Day06");

    //记录位置
    long tag = telldir(dir);

    while(1){
        
        struct dirent *pDirent = readdir(dir);
        if(pDirent == NULL){
            // 遍历完成

            seekdir(dir, tag);

            sleep(3);
            continue;
        }
        printf("%s \n", pDirent->d_name);

    }




    closedir(dir);
    return 0;
}

